package com.lingxu.api.ztb.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lingxu.api.ztb.model.vo.GetTBUnitVO;
import com.lingxu.api.ztb.service.IGetTBUnitService;
import com.lingxu.base.common.api.vo.Result;
import com.lingxu.base.common.api.vo.ResultOne;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import oracle.ucp.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@Validated
@CrossOrigin
@RestController
@RequestMapping("/getTBUnitController")
public class GetTBUnitController {

    @Autowired
    IGetTBUnitService iGetTBUnitService;

    @PostMapping("/getUnit")
    public ResultOne<GetTBUnitVO> getTBUnit(@RequestBody GetTBUnitVO getTBUnitVO) {
        IPage<GetTBUnitVO> list = iGetTBUnitService.list(getTBUnitVO);
        return ResultOne.ok(list);
    }
}
